package TCP;

import java.io.*;
import java.net.Socket;

public class Client {
    public static void main(String[] args) throws IOException {
        //创建管道对象
        Socket socket = new Socket("127.0.0.1",8888);

        //获取到输出流
        OutputStream os = socket.getOutputStream();
        //将其低级的输出流升级为高级的输出流
        DataOutputStream dos = new DataOutputStream(os);

        dos.writeUTF("需要发送的消息!!!");

        //关闭资源
        dos.close();
        socket.close();

    }
}
